﻿@{
    Layout = null;
}
@model ElingOA6_Admin_DSJCJ.Model.PerformancePrj
<!DOCTYPE html>

<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title>DeptContent</title>
      @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/PageCommon.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme },
                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)

    <script type="text/javascript">
        $(function () {
            $("#toolMenu").smartFloat();
            var hdjsAlert = $("#hdjsAlert").val();
            if (hdjsAlert == "ok") {
                alert("操作成功");
                window.location.href = rootPath + '/Admin/Performance';
            }
            else if (hdjsAlert == "error") {
                alert("操作失败");
            }
            else {
                if (hdjsAlert != "") {
                    alert(hdjsAlert);
                }
            }
        });

        function OnBeginCallback(s, e) {
            e.customArgs["command"] = e.command;
            e.customArgs["FPerformancePrjID"] = $('#hidFPerformancePrjID').val();
        }

        function save() {
            var fSeq = FSeq.GetValue();
            var fPrjName = FPrjName.GetValue();
            var fExecDept = FExecDept.GetText();

            if (fSeq == null || ASPxClientUtils.Trim(fSeq) == "") {
               alert("序号必须填写！");
                return;
            }

            if (fPrjName == null || ASPxClientUtils.Trim(fPrjName) == "") {
                alert("项目名称必须填写！");
                return;
            }

            if (fExecDept == null || ASPxClientUtils.Trim(fExecDept) == "") {
                alert("主管局必须填写！");
                return;
            }

            form1.submit();
        }

        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnSave":
                    {
                        //保存
                        save();
                        break;
                    }
            }
        }

        //增加岗位
        function PerformancePrjEntryAdd() {
            var rs = window.showModalDialog(rootPath + "/Admin/Performance/PerformancePrjEntryEdit?FPerformancePrjID=" + $("#hidFPerformancePrjID").val(), 'Edit', 'dialogWidth:350px;dialogHeight:300px');
            if (typeof (rs) != "undefined") {
                gvEditing.Refresh();
            }
        }

//        //修改岗位
//        function PerformancePrjEntryEdit(positionNo) {
//            var rs = window.showModalDialog(rootPath + "/Admin/Performance/PerformancePrjEntryEdit?FPerformancePrjID=" + $("#hidFPerformancePrjID").val() + "&FPerformancePrjEntryID=" + positionNo, 'Edit', 'dialogWidth:350px;dialogHeight:300px');
//            if (typeof (rs) != "undefined") {
//                gvEditing.Refresh();
//            }
//        }

        //删除岗位
        function PerformancePrjEntryDel(No) {
            if (confirm("确定删除?")) {
                var fPerformancePrjID = $('#hidFPerformancePrjID').val();
                $.ajax({
                    type: 'POST',
                    url: rootPath + '/Admin/Performance/PerformancePrjEntryDel',
                    data: { fPerformancePrjID: fPerformancePrjID, No: No },
                    success: function (resutl) {
                        if (resutl == "ok") {
                            alert("删除成功");
                            gvEditing.Refresh();
                        }
                        else if (resutl == "no") {
                            alert("数据部存在");
                        }
                        else if (resutl == "error") {
                            alert("删除失败");
                        }
                        else if (resutl == "") {
                            alert("参数错误!");
                        }
                    }
                });
            }

        }

    </script>

</head>
<body>
    @using (Html.BeginForm("Save", "Performance", FormMethod.Post, new { id = "form1", @class = "tableFrom", enctype = "multipart/form-data" }))
    {
        <div class="floatToolMenu" id="toolMenu">
            @Html.DevExpress().Menu(settings =>
       {
           settings.Name = "toolBarMenu";
           settings.ItemAutoWidth = false;
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
           settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
           settings.Items.Add(item =>
      {
          item.Name = "btnSave";
          item.Text = "保存";
          item.ClientEnabled = true;
          item.Image.Url = Url.Content("~/Content/ControlImages/filesave.png");

      });
           settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
           settings.ItemLinkMode = ItemLinkMode.ContentBounds;
       }).GetHtml()
        </div>
 
        <table class="tableForm" style=" font-size:12px">
            <tr>
                <th>
                    序号:</th>
                <td class="tdClass" >
                    @Html.DevExpress().TextBox(settings =>
           {
               settings.Name = "FSeq";
               settings.Width = 200;
               settings.Text = Model.FSeq.ToString();
               settings.Properties.ValidationSettings.EnableCustomValidation = true;
           }).GetHtml()
                </td>
                       </tr>
              <tr>
                <th>
                    项目名称:</th>
                <td class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
           {
               settings.Name = "FPrjName";
               settings.Width = 200;
               settings.Text = Model.FPrjName;
               settings.Properties.ValidationSettings.EnableCustomValidation = true;
           }).GetHtml()</td>
            </tr>
            <tr>
                <th>
                    归口科室:</th>
                <td class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
           {
               settings.Name = "FRelevantDept";
               settings.Width = 200;
               settings.Text = Model.FRelevantDept;
           }).GetHtml()
                </td>
                       </tr>
              <tr>
                <th>
                    主管局:</th>
                <td class="tdClass">
                    @Html.DevExpress().TextBox(
            settings =>
            {
                settings.Name = "FExecDept";
                settings.Width = 200;
                settings.Text = Model.FExecDept;
            }).GetHtml()
                </td>
            </tr>
            <tr>
                <th>
                    项目状态:</th>
                <td class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
       {
           settings.Name = "FStatus";
           settings.Width = 200;

           settings.Text = Model.FStatus;

       }).GetHtml()
                </td>
              </tr>
              <tr>
                <th>
                    项目进度:</th>
                <td class="tdClass">
                @Html.DevExpress().TextBox(settings =>
                   {
                       settings.Name = "FProcess";
                       settings.Width = 200;
                       settings.Text = Model.FProcess;
                   }).GetHtml()
                </td>
            </tr>
                          <tr>
                <th>
                    年度:</th>
                <td class="tdClass">
                @Html.DevExpress().TextBox(settings =>
                   {
                       settings.Name = "FYear";
                       settings.Width = 200;
  
                       settings.Text = Model.FYear.ToString();
                   }).GetHtml()
                </td>
            </tr>
        </table>
    
        <br />
      
    
        @Html.Partial("PerformancePrjEntryPartial", @ViewData["PerformancePrjEntryList"])

              @Html.Hidden("hdjsAlert", ViewData["jsAlert"])
          @Html.Hidden("hidFPerformancePrjID", Model.FPerformancePrjID)
    }
</body>
</html>
